#******************************************************************************
#******************************************************************************

# import pytest

from src.hyhetra.pipes.classes import StandardisedPipeDatabase
from src.hyhetra.common.fluids import FluidDatabase

from examples_factors import examples as examples_factors
from examples_fic_dff import examples as examples_fic_dff
from examples_fic import examples as examples_fic
from examples_fluids import examples as examples_fluids
from examples_utils import examples as examples_utils
from examples_pipes import examples as examples_pipes
from examples_trenches import examples as examples_trenches

#******************************************************************************
#******************************************************************************

def test_suite():
    
    # load fluid data
    
    # load pipe data
        
    singlepipedata_files = ['tests/data/isoplus_singlepipes_s1.csv',
                            'tests/data/isoplus_singlepipes_s2.csv',
                            'tests/data/isoplus_singlepipes_s3.csv']
    
    singlepipedb = StandardisedPipeDatabase(source=singlepipedata_files)
    
    # twin pipe data files
    
    twinpipedata_files = ['tests/data/isoplus_twinpipes_s1.csv',
                          'tests/data/isoplus_twinpipes_s2.csv',
                          'tests/data/isoplus_twinpipes_s3.csv']
    
    twinpipedb = StandardisedPipeDatabase(source=twinpipedata_files)
    
    # get oil properties' database
    
    oildata_file = 'tests/data/incropera2006_engine_oil.csv'

    oil_db = FluidDatabase(fluid='oil',
                           phase='l', 
                           source=oildata_file)
    
    # get water properties' database
    
    waterdata_file = 'tests/data/incropera2006_saturated_water.csv'

    water_db = FluidDatabase(fluid='fluid',
                             phase='l',
                             source=waterdata_file)
    
    # get air properties' database
    
    airdata_file = 'tests/data/incropera2006_air_1atm.csv'

    air_db = FluidDatabase(fluid='air',
                           phase='g',
                           source=airdata_file)
    
    #**************************************************************************
    #**************************************************************************
    
    print('About to start testing \'factors\'...')
    
    examples_factors()
    
    print('Testing \'factors\' complete.')
    
    #**************************************************************************
    
    print('About to start testing \'fic-dff\'...')
    
    examples_fic_dff(singlepipedb=singlepipedb)
    
    print('Testing \'fic-dff\' complete.')
    
    #**************************************************************************
    
    print('About to start testing \'fic\'...')
    
    examples_fic(oil_db=oil_db, 
                  water_db=water_db, 
                  air_db=air_db)
    
    print('Testing \'fic\' complete.')
    
    # #**************************************************************************
    
    print('About to start testing \'fluids\'...')
    
    examples_fluids(fluiddb=water_db)

    print('Testing \'fluids\' complete.')
    
    # #**************************************************************************
    
    print('About to start testing \'utils\'...')
    
    examples_utils(fluiddb=water_db, 
                   singlepipedb=singlepipedb,
                   twinpipedb=twinpipedb)

    print('Testing \'utils\' complete.')
    
    #**************************************************************************
    
    print('About to start testing \'pipes\'...')
    
    examples_pipes(singlepipedb=singlepipedb, 
                    twinpipedb=twinpipedb)

    print('Testing \'pipes\' complete.')
    
    #**************************************************************************
    
    print('About to start testing \'trenches\'...')
    
    examples_trenches(fluiddb=water_db,
                      singlepipedb=singlepipedb, 
                      twinpipedb=twinpipedb)

    print('Testing \'trenches\' complete.')

    #**************************************************************************
    #**************************************************************************

#******************************************************************************
#******************************************************************************